package com.sky.orangehireserver.modules.admin.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;

/**
 * 企业用户创建请求DTO
 * 
 * @author sky
 */
@Data
@Schema(description = "企业用户创建请求DTO")
public class EnterpriseUserCreateDTO {

    /**
     * 所属企业ID
     */
    @NotNull(message = "所属企业ID不能为空")
    @Schema(description = "所属企业ID", example = "1")
    private Long orgId;

    /**
     * 用户姓名
     */
    @NotBlank(message = "用户姓名不能为空")
    @Size(max = 50, message = "用户姓名长度不能超过50个字符")
    @Schema(description = "用户姓名", example = "张三")
    private String name;

    /**
     * 邮箱/登录账号
     */
    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    @Size(max = 100, message = "邮箱长度不能超过100个字符")
    @Schema(description = "邮箱/登录账号", example = "zhangsan@company.com")
    private String email;

    /**
     * 登录密码
     */
    @NotBlank(message = "密码不能为空")
    @Size(min = 6, max = 20, message = "密码长度必须在6-20个字符之间")
    @Pattern(regexp = "^(?=.*[a-zA-Z])(?=.*\\d)[a-zA-Z\\d@$!%*?&]{6,20}$", 
             message = "密码必须包含字母和数字，长度6-20位")
    @Schema(description = "登录密码", example = "123456a")
    private String password;

    /**
     * 用户角色
     */
    @NotBlank(message = "用户角色不能为空")
    @Pattern(regexp = "^(Admin|Recruiter)$", message = "用户角色只能是Admin或Recruiter")
    @Schema(description = "用户角色", example = "Admin", allowableValues = {"Admin", "Recruiter"})
    private String role;

    /**
     * 头像URL
     */
    @Size(max = 500, message = "头像URL长度不能超过500个字符")
    @Schema(description = "头像URL")
    private String avatar;
}